package com.liuyi.tools.web.unusual;

/**
 * @author Mr.fmy
 * @version 1.0.0
 * @ClassName BizException
 * @Description TODO 自定义业务异常类
 * @createTime 2020/3/28 11:04
 */
public class BizException extends RuntimeException {
    protected IEnum iEnum;
    protected Object[] args;


    public BizException(IEnum iEnum) {
        super(iEnum.getDefultMsg());
        this.iEnum = iEnum;
    }

    public BizException(IEnum iEnum, String message) {
        super(message);
        this.iEnum = iEnum;
    }

    public BizException(String message) {
        super(message);
        this.iEnum = BizEnum.BUSINESS_FAIL;
    }

    public BizException(IEnum iEnum, String message, Object[] args) {
        super(message);
        this.iEnum = iEnum;
        this.args = args;
    }

    public BizException(IEnum iEnum, Object[] args) {
        super(iEnum.getDefultMsg());
        this.iEnum = iEnum;
        this.args = args;
    }

    public BizException(String message, Object[] args) {
        super(message);
        this.iEnum = BizEnum.BUSINESS_FAIL;
        this.args = args;
    }


    public IEnum getIEnum() {
        return this.iEnum;
    }

    public Object[] getArgs() {
        return this.args;
    }
}